<?
namespace app\admin\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule =   [
		'id'	=>'require|number', 
		'title'	=>'require|max:50|min:5',
		'author' =>'chsDash',
		'status'	=> 'boolean',
    ];
    
    protected $message  =   [
		'id.same'				=>	'默认账号无法删除,无法编辑权限!!',
		'title.require'	=>	'标题必须',
		'id.require'	=>	'ID必须',
		'number.require'	=>	'ID无效',
		'title.max'		=>	'标题最多50个字符',
		'title.min'		=>	'标题最少5个字符'
    ];
    protected $scene = [
		'add'	=>['title'],
		'edit'  =>  ['id','title'],
		'del'  =>  ['id'],
		'cue'	=> ['id','title','author']
    ];
    public function sceneCue()
    {
    	return $this->only(['id','title','author'])
            ->remove('title', 'require');
    } 
}